package com.xinya.taobaosale.ui.activity;

import android.os.Bundle;

import androidx.appcompat.app.AppCompatActivity;

import butterknife.ButterKnife;
import butterknife.Unbinder;

/**
 * @ClassName: BaseActivity
 * @Description: java类作用描述
 * @Author: mhzhuxinya@163.com
 * @UpdateRemark: 更新说明：
 * @Version: 1.0
 */
public abstract class BaseActivity extends AppCompatActivity {

    private Unbinder mUnbinder;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        setContentView(getContentViewByViewId());

        mUnbinder = ButterKnife.bind(this);

        registerPresenter();
        initView();
        initEvent();
    }


    @Override
    protected void onDestroy() {
        super.onDestroy();
        mUnbinder.unbind();

        unRegisterPresenter();
    }

    protected void registerPresenter() {

    }

    protected void unRegisterPresenter() {

    }

    protected abstract int getContentViewByViewId();

    protected abstract void initView();

    protected abstract void initEvent();


}
